package com.ruoyi.biz.report.letter.service;

import com.ruoyi.biz.category.mapper.BizCategoryMapper;
import com.ruoyi.biz.letter.mapper.BizMayorHotlineMapper;
import com.ruoyi.biz.letter.mapper.BizMessageBoardMapper;
import com.ruoyi.biz.report.letter.vo.CategoryReportReq;
import com.ruoyi.biz.report.letter.vo.ReportCityCategoryResp;
import com.ruoyi.biz.report.letter.vo.ReportYearCategoryResp;
import com.ruoyi.biz.report.letter.vo.ReportYearCityResp;
import com.ruoyi.biz.report.mapper.BizReportConfigMapper;
import com.ruoyi.system.mapper.SysDeptMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Fei.Cong
 * @date 2024-09-03 10:57
 */
@Service
@RequiredArgsConstructor
public class MessageReportService {

    private final BizMessageBoardMapper bizMessageBoardMapper;
    private final CategoryService categoryService;

    public List<ReportCityCategoryResp> getReportGroupByCityAndCategory(CategoryReportReq reportReq) {
        List<ReportCityCategoryResp> hotlineReportResps = bizMessageBoardMapper.selectReportGroupCityAndCategory(reportReq);
        return categoryService.getReportCityAndCategory(hotlineReportResps);
    }

    public List<ReportYearCityResp> selectReportGroupMonthAndCity(CategoryReportReq reportReq) {
        List<ReportYearCityResp> hotlineReportResps = bizMessageBoardMapper.selectReportGroupMonthAndOwnerArea(reportReq);
        return categoryService.getReportMonthAndCity(hotlineReportResps, reportReq);
    }

    public List<ReportYearCategoryResp> getReportGroupByMonthAndCategory(CategoryReportReq reportReq) {
        List<ReportYearCategoryResp> hotlineReportResps = bizMessageBoardMapper.selectReportGroupMonthAndCategory(reportReq);
        return categoryService.getReportMonthAndCategory(hotlineReportResps, reportReq);
    }
}
